#include<stdio.h>
int main()
{
    int z,m,t;
    scanf("%d/%d",&z,&m);
    if(z<m)
    {
        while(z!=0)
        {
            t=m/z;
            z=z/t;
            m=m/t;
            printf("%d/%d",z/t,m/t);
        }
    }
    else
    {
        while(m!=0)
        {
             t=m/z;
            z=z/t;
            m=m/t;
            printf("%d/%d",z/t,m/t);
        }
    }
}
